/** 
  *@form 存放数据的对象 {value： 1， xxx: xxx}
  *@rules 校验规则 {value: {required: true, message: '请输入内容'}}
  *@callback 校验成功后的回调函数
 */
export const verify = (form, rules, callback) => {
	let flag = true;
	let message = '';
	for(let key in rules) {
		if(rules[key].required && !form[key]) {
			flag = false;
			message = rules[key].message;
			continue;
		}
	}
	
	if(!flag) {
		uni.showToast({title: message, icon: 'none'})
	} else {
		callback()
	}
}